package Demo01;

/**
 * @ClassName Test
 * @Description TODO
 * @Author 李明忠
 * @Date 2025/5/15 9:18
 * @Version 1.0
 */
public class Test {
    public static int add(int a, int b) {
        return a + b;
    }
    public static void main(String[] args) {
        int a = 10;
        int b = a;
        int c = add(a, b);
        System.out.println(c);
    }
}
/**
 * 字节码如下：
 * Compiled from "Test.java"
 * public class Demo01.Test {
 *   public Demo01.Test();
 *     Code:
 *        0: aload_0
 *        1: invokespecial #1                  // Method java/lang/Object."<init>":()V
 *        4: return
 *
 *   public static int add(int, int);
 *     Code:
 *        0: iload_0
 *        2: istore_1
 *        3: iload_1
 *        4: istore_2
 *        5: iload_1
 *        6: iload_2
 *        7: invokestatic  #7                  // Method add:(II)I
 *       10: istore_3
 *       11: getstatic     #13                 // Field java/lang/System.out:Ljava/io/PrintStream;
 *       14: iload_3
 *       15: invokevirtual #19                 // Method java/io/PrintStream.println:(I)V
 *       18: return
 * }
 */
